function CancelBubble(t){if(t.stopPropagation){t.preventDefault();t.stopPropagation()}else{t.cancelBubble=true;t.returnValue=false}}function htmlspecialchars(t){if(typeof t!="string")return t;t=t.replace(/&/g,"&amp;");t=t.replace(/"/g,"&quot;");t=t.replace(/</g,"&lt;");t=t.replace(/>/g,"&gt;");return t}function strip_tags(t){return t.replace(/<\/?[^>]+>/gi,"")}function CAjaxForm(t,e,r){var n=document.forms[t];if(!n)n=document.getElementById(t);this.nextStep=n.elements[r];this.nextStepStage=n.elements[r+"Stage"];this.iframe=document.getElementById(e);this.form=n;this.form.target=e;var i=this;if(this.iframe.attachEvent)this.iframe.attachEvent("onload",function(){i.AjaxHandler()});else this.iframe.onload=function(){i.AjaxHandler()};this.percent=null;this.percent2=null;this.indicator=null;this.status=null}CAjaxForm.prototype.AjaxHandler=function(){if(this.iframe.contentWindow&&this.iframe.contentWindow.location.href.indexOf("http")!=0)return;if(this.iframe.contentDocument)var t=this.iframe.contentDocument;else var t=this.iframe.contentWindow.document;var e=t.body.innerHTML;if(e.length==0||t.getElementById("bitrix_install_template")){this.ShowError("Connection error. Empty response.");return}var r=new RegExp("\\[response\\]","i");var n=new RegExp("\\[/response\\]","i");var i=e.match(r);if(i===null){this.ShowError(e);return}var o=i.index+i[0].length;var a=e.search(n);if(a==-1){this.ShowError(e);return}e=e.substr(o,a-o);window.eval(e)};CAjaxForm.prototype.ShowError=function(t){var e=document.getElementById("error_container");var r=document.getElementById("error_text");if(!e||!r)return;var n=document.getElementById("wait");if(n)n.style.display="none";e.style.display="block";r.innerHTML=strip_tags(t);var i=document.getElementById("error_retry_button");var o=document.getElementById("error_skip_button");var a=this;var s=this.nextStep.value;var l=this.nextStepStage.value;i.onclick=function(){a.HideError();a.Post(s,l,"")};if(s=="main")o.onclick=function(){a.HideError();a.Post(s,l,"")};else o.onclick=function(){a.HideError();a.Post(s,"skip","")}};CAjaxForm.prototype.HideError=function(){var t=document.getElementById("error_container");var e=document.getElementById("error_text");if(!t||!e)return;while(e.firstChild)e.removeChild(e.firstChild);t.style.display="none";var r=document.getElementById("wait");if(r)r.style.display="block"};CAjaxForm.prototype.Post=function(t,e,r){if(t)this.nextStep.value=t;if(e)this.nextStepStage.value=e;this.form.submit();if(!this.status)this.status=document.getElementById("status");if(r.length>0)this.status.innerHTML=r+"..."};CAjaxForm.prototype.StopAjax=function(){this.iframe.onload=null;this.form.target="_self"};CAjaxForm.prototype.SetStatus=function(t){if(!this.percent)this.percent=document.getElementById("percent");if(!this.percent2)this.percent2=document.getElementById("percent2");if(!this.indicator)this.indicator=document.getElementById("indicator");this.percent.innerHTML=t+"%";this.percent2.innerHTML=t+"%";this.indicator.style.width=t+"%"};function PreloadImages(t){var e=["prev.gif","error.gif","wait.gif","admin.gif","public.gif"];for(var r=0;r<e.length;r++){var n=new Image;n.src=t+e[r]}}function ImgShw(t,e,r,n){var i="no";var o=0,a=0;if(e>screen.width-10||r>screen.height-28)i="yes";if(r<screen.height-28)o=Math.floor((screen.height-r)/2-14);if(e<screen.width-10)a=Math.floor((screen.width-e)/2-5);e=Math.min(e,screen.width-10);r=Math.min(r,screen.height-28);var s=window.open("","","scrollbars="+i+",resizable=yes,width="+e+",height="+r+",left="+a+",top="+o);s.document.write("<html><head>"+"<"+'script type="text/javascript">'+"function KeyPress()"+"{"+"	if(window.event.keyCode == 27) "+"		window.close();"+"}"+"</"+"script>"+"<title></title></head>"+'<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" onKeyPress="KeyPress()">'+'<img src="'+t+'" border="0" alt="'+n+'" />'+"</body></html>");s.document.close()}
//# sourceMappingURL=script.map.js